#ifndef X_HIDDEVICE_H
#define X_HIDDEVICE_H

#include <QObject>
#include "libusb/libusb.h"

class X_HidDevice : public QObject
{
    Q_OBJECT
public:
    bool isDeviceOpen;
    X_HidDevice();
    bool OpenDevice(uint16_t PID , uint16_t VID);
    void ReadData(uint8_t* RxData);
    bool WriteData(uint8_t* RxData);
    void Close(void);

    //全局初始化库函数
    static void LibInit(void);
    static void LibExit(void);
    static bool isLibInit;

    int Device_Addr;

private:
    libusb_device_handle *dev_handle;
};

#endif // X_HIDDEVICE_H
